package com.qmyx.supply.admin.controller;

import com.ytjj.qmyx.supplychain.common.api.CommonResult;
import com.ytjj.qmyx.supplychain.service.BankerMessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 
 * 
 * @Version: 1.0
 */
@RestController
@RequestMapping("/bankerMessage")
public class BankerMessageController {

    @Autowired
    private BankerMessageService bankerMessageService;

    @PostMapping("/waitLookList")
    public CommonResult waitLookList(){
        return CommonResult.success(bankerMessageService.waitLookList());
    }

    @PostMapping("/outLookList")
    public CommonResult outLookList(){
        return CommonResult.success(bankerMessageService.outLookList());
    }

    @GetMapping("/updateStatus")
    public CommonResult updateStatus(@RequestParam Integer id) {
        Integer count = bankerMessageService.updateStatus(id);
        if(count > 0) {
            return CommonResult.success(count);
        } else {
            return CommonResult.failed();
        }
    }

    @GetMapping("/getRemarks")
    public CommonResult getRemarks(@RequestParam Integer id) {
        return CommonResult.success(bankerMessageService.getRemarks(id));
    }
}
